package com.aree.caipiao.shsq.chain;

import java.util.List;

import com.aree.caipiao.shsq.model.ShuangSeQiuNumbers;

/**
 * 幸运号过滤器
 * @author hp-pc
 *
 */
public class LuckeyNumberChooseChain extends ChooseChain {
	private List<Integer> luckeyNumbers;
	
	public LuckeyNumberChooseChain(List<Integer> luckeyNumbers) {
		this.luckeyNumbers = luckeyNumbers;
	}

	/* (non-Javadoc)
	 * @see com.aree.caipiao.shsq.chain.ChooseChain#isWanted(com.aree.caipiao.shsq.model.ShuangSeQiuNumbers)
	 */
	@Override
	protected boolean isWanted(ShuangSeQiuNumbers numbers) {
		if (isEmpty(luckeyNumbers)) return true;
		int[] nums = numbers.getNumbers();
		for (int num : nums) {
			for (int luckey : luckeyNumbers) {
				if (num == luckey) return true;
			}
		}
		return false;
	}

}
